﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace QuanLyDiemSinhVien.Manager
{
    public class ClassInfo
    {
        private readonly int _classId;
        private string _className;
        private string _schoolYear;
        private int _teacherId;
        private bool _status;

        public ClassInfo(){}

        public ClassInfo(DataTable dtb)
        {
            if (dtb != null && dtb.Rows.Count > 0)
            {
                _classId = Convert.ToInt32(dtb.Rows[0][0].ToString());
                _className = dtb.Rows[0][1].ToString();
                _schoolYear = dtb.Rows[0][2].ToString();
                _teacherId = Convert.ToInt32(dtb.Rows[0][3].ToString());
                _status = Convert.ToBoolean(dtb.Rows[0][4].ToString());
            }
        }

        public int StudentId { get { return _classId; } }

        public string ClassName
        {
            set { _className = value; }
            get { return _className; }
        }

        public string SchoolYear
        {
            set { _schoolYear = value; }
            get { return _schoolYear; }
        }

        public int TeacherId
        {
            set { _teacherId = value; }
            get { return _teacherId; }
        }

        public bool Status
        {
            set { _status = value; }
            get { return _status; }
        }
    }
}
